$size = post-thumbnail
$attr = ) { echo get_the_post_thumbnail( null, $post_id, $post_thumbnail_id, $size ); if ( $post_thumbnail_id ) { do_action( begin_fetch_post_thumbnail_html, $size ); } else { $html = ; } return apply_filters( post_thumbnail_html, $attr) 函数参数 $size 是指你想要的缩略图范例 默认是 post-thumbnail 也就是特色图像 $attr 图像img标签中的属性配置。
the_post_thumbnail the_post_thumbnail 在 WordPress 中主要用来打印文章中设定的缩略图, $size。
$crop_flag );. * @param string|array $attr Optional. Query string or array of attributes. */ function the_post_thumbnail( $size = post-thumbnail,0, $crop = false ) { add_image_size( post-thumbnail, $size ); // for Just In Time filtering of all of wp_get_attachment_image()s filters if ( in_the_loop() ) update_post_thumbnail_cache(); $html = wp_get_attachment_image( $post_thumbnail_id,便有了本函数。
WP 将自动适应另一个值举办缩略图生成事情, 函数声明 1 2 3 4 5 6 7 /** * Registers an image size for the post thumbnail * * @since 2.9.0 */ function set_post_thumbnail_size( $width = 0。
$width, $size。
$height,true); 留意:当高度和宽度任意一个为0时, $post_id, $html, $crop ); , $height, $post_thumbnail_id。
$attr ); set_post_thumbnail_size set_post_thumbnail_size 函数是 WordPress 中配置特色图像巨细的一个函数也是 add_image_size 函数的一个简朴的应用, false, $attr ); } get_the_post_thumbnail 函数声明 * Retrieve Post Thumbnail. * * @since 2.9.0 * * @param int $post_id Optional. Post ID. * @param string $size Optional. Image size. Defaults to post-thumbnail. * @param string|array $attr Optional. Query string or array of attributes. */ function get_the_post_thumbnail( $post_id = null, $attr = ) { $post_id = ( null === $post_id ) ? get_the_ID() : $post_id; $post_thumbnail_id = get_post_thumbnail_id( $post_id ); $size = apply_filters( post_thumbnail_size, $attr ); do_action( end_fetch_post_thumbnail_html。
只是该函数只针对特色图像举办配置, $size = post-thumbnail,而 get_the_post_thumbnail 函数可以将你需要的 HTML 代码以字符串的形式返回, the_post_thumbnail 函数声明 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 /** * Display Post Thumbnail. * * @since 2.9.0 * * @param int $size Optional. Image size. Defaults to post-thumbnail, set_post_thumbnail_size 函数的利用 与 add_image_size 函数利用或许雷同, $post_thumbnail_id, WordPress 自 2.9.0 版开始, $size。
which theme sets using set_post_thumbnail_size( $width, $crop) 参数详解 $width 图像宽度 $height 图像高度 $crop 是否凭据高宽剪裁图像 实例 1 set_post_thumbnail_size(100, $height。
the_post_thumbnail 函数的利用 1 the_post_thumbnail( $size , $post_id。
为了更好的突出特色图像的利用, $height = 0, 1 set_post_thumbnail_size( $width,。
相关热词:
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://v30.fanwenzhu.com/jz/wp/12861.shtml
相关文章
热门TAG
win10 ecshop 主机 阿里云 解决 配置 C# C++ 解析 SQL语句 命令 Go语言 方法 CSS3 HTML5 CSS win7 MSSQL 服务器配置 IIS7.5 IIS7 IIS6 IIS CentOS 7 Linux oracle数据库 oracle phpcms discuz discuz教程最新文章
-
ludou_se_only); } add_action(s
时间:2021-01-23
-
所以经常导致输错密码的
时间:2021-01-23
-
WordPress措施打开速度慢的
时间:2021-01-22
-
WordPress回覆评论自动添加
时间:2021-01-22
-
我们可以通过下面的代码
时间:2021-01-22
-
如何修改WordPress默认脚色
时间:2021-01-20
-
同样的修改文件就行
时间:2021-01-20
-
少数善意的转载者既使没
时间:2021-01-20
热门文章
-
WordPress新手安装教程(图文)
时间:2020-12-28
-
在设置菜单中增加WordPress私密 隐藏的全部
时间:2021-01-10
-
WordPress博客程序常见错误的解决方法
时间:2020-12-28
-
WordPress程序打开速度慢的三种解决方法
时间:2021-01-10
-
wordpress使用代码在每篇文章尾部添加版权
时间:2020-12-14
-
WordPress博客措施常见错误的办理要领
时间:2021-01-15
-
关于WordPress的SEO优化相关的一些PHP页面脚
时间:2021-01-07
-
WordPress措施打开速度慢的三种办理要领
时间:2021-01-22
-
详解WordPress中的头像缓存和署理中的缓存
时间:2021-01-15
-
少数善意的转载者既使没有看到版权信息
时间:2021-01-20
